<template>
  <div>
    <span>{{count}}</span>
    <el-button @click="clickAdd">add</el-button>
  </div>
</template>
<script lang='ts' setup>
import { onActivated, onDeactivated } from 'vue'
let count = $ref(1)
const clickAdd = () => {
  count++
}
onActivated(() => {
  console.log(21)
})
onDeactivated(() => {
  console.log(22)
})
</script>